from appium import webdriver
import base64
import os

from appium.webdriver.common.touch_action import TouchAction
from selenium.webdriver.support.wait import WebDriverWait


desired_caps = {}
desired_caps["platformName"] = "Android"
desired_caps["platformVersion"] = "7.0"
desired_caps["deviceName"] = "192.168.205.101:5555"
desired_caps["appPackage"] = "com.amaze.filemanager"
desired_caps["appActivity"] = ".activities.MainActivity"

driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)

# with open("./a.txt", "r", encoding="utf-8") as f:
#     data = str(base64.b64encode(f.read().encode("utf-8")), "utf-8")
#     driver.push_file("/sdcard/Download/a.txt", data)

# TouchAction(driver).move_to()
print(driver.device_time)
print(driver.get_window_size())
driver.set_network_connection()

driver.quit()